"""
 Flash OS Routines (Automagically Generated)
 Copyright (c) 2017-2017 ARM Limited
"""

flash_algo = {
    'load_address' : 0x20000000,
    'instructions' : [
        0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
        0x4770BA40, 0x4770BA40, 0x4770BA40, 0x4770BA40, 0x4770BA40, 0x4770BAC0, 0x4770BAC0, 0x4770BAC0,
        0x4770BAC0, 0x4770BAC0, 0x2A01B510, 0x491ED104, 0x60084449, 0xF83CF000, 0xBD102000, 0x47702000,
        0xB5104919, 0x68094449, 0xF0001A40, 0x2000F8B6, 0x2001BD10, 0x46134770, 0xB5104A13, 0x6812444A,
        0xB28A1A80, 0x46184601, 0xF8D7F000, 0xBD102000, 0x4604B570, 0x460D480C, 0x46164448, 0xB2AA6800,
        0x480A1A21, 0xF0004448, 0x4B08F954, 0x444B2000, 0x5C195C32, 0xD0014291, 0xBD704420, 0x28FF1C40,
        0x1960DDF6, 0x0000BD70, 0x00000004, 0x0000001C, 0xB086B510, 0xF2412101, 0xF000000C, 0x20E0FBFC,
        0x0014F8AD, 0xF88D2403, 0x20184016, 0x0017F88D, 0x48D4A905, 0xFC99F000, 0xF8AD2004, 0xF88D0014,
        0x20104016, 0xF88D4CD0, 0xA9050017, 0xF0004620, 0x2104FC8C, 0xF0004620, 0x2000FCF3, 0x0000F8AD,
        0x7182F44F, 0x1002F8AD, 0x0004F8AD, 0xF8AD2102, 0x21011006, 0x1008F8AD, 0xF8AD0249, 0x2108100A,
        0x100CF8AD, 0x000EF8AD, 0x4CC02007, 0x0010F8AD, 0x46204669, 0xF9A0F000, 0x46202101, 0xFA16F000,
        0xBD10B006, 0x4CB9B570, 0x21024605, 0xF0004620, 0x2800FA79, 0x4629D0F9, 0xF0004620, 0x2101FA2F,
        0xF0004620, 0x2800FA6F, 0x4620D0F9, 0xFA28F000, 0xBD70B2C0, 0x4CACB510, 0x46202104, 0xFCB2F000,
        0xF7FF2005, 0x20A5FFDF, 0xFFDCF7FF, 0xD1FA07C0, 0xE8BD4620, 0x21044010, 0xBCA2F000, 0x4CA2B510,
        0x46202104, 0xFC9EF000, 0xF7FF2006, 0x4620FFCB, 0x4010E8BD, 0xF0002104, 0xB570BC93, 0xF7FF4604,
        0x4D99FFED, 0x46282104, 0xFC8CF000, 0xF7FF20D8, 0xF3C4FFB9, 0xF7FF4007, 0xF3C4FFB5, 0xF7FF2007,
        0xB2E0FFB1, 0xFFAEF7FF, 0x46282104, 0xFC78F000, 0x4070E8BD, 0xB510E7BE, 0xFFD0F7FF, 0x21044C8A,
        0xF0004620, 0x20C7FC6F, 0xFF9CF7FF, 0x46202104, 0xFC66F000, 0x4010E8BD, 0xE92DE7AC, 0x460541F0,
        0x4614460E, 0xFFBAF7FF, 0x21044F7F, 0xF0004638, 0x2002FC59, 0xFF86F7FF, 0x4007F3C6, 0xFF82F7FF,
        0x2007F3C6, 0xFF7EF7FF, 0xF7FFB2F0, 0xE003FF7B, 0xF7FF7828, 0x1C6DFF77, 0xF1A40020, 0xB2A40401,
        0x2104D1F6, 0xF0004638, 0xE8BDFC3B, 0xE78141F0, 0x4DF0E92D, 0x4607460E, 0x01FFF011, 0x0000F1C1,
        0xEA4FB2C5, 0xF0022412, 0xF44F0AFF, 0xD0137B80, 0x4240B2F0, 0xEB06B2C0, 0xB31C0800, 0xB2801B50,
        0xF0000A04, 0x462A0AFF, 0x46384631, 0xFFB5F7FF, 0x4646443D, 0xE02C465F, 0x465DB17C, 0xF1A40020,
        0xB2E40401, 0x462AD00C, 0x46384631, 0xFFA5F7FF, 0x7680F506, 0x7780F507, 0x4631E7F0, 0xE0234638,
        0xE7FA4652, 0xD9F845AA, 0x0005EBAA, 0x462AB2C4, 0x46384631, 0xFF91F7FF, 0x19784641, 0xE0134622,
        0x4631463A, 0xF7FF4628, 0xF506FF88, 0xF5057680, 0x00207580, 0x0401F1A4, 0xD1F1B2E4, 0x000AEA5F,
        0x4602D005, 0x46284631, 0x4DF0E8BD, 0xE8BDE775, 0xE92D8DF0, 0x4F3C41F0, 0x460E4605, 0x21044614,
        0xF0004638, 0x2003FBCF, 0xFEFCF7FF, 0x4007F3C6, 0xFEF8F7FF, 0x2007F3C6, 0xFEF4F7FF, 0xF7FFB2F0,
        0xE004FEF1, 0xF7FF20A5, 0xF805FEED, 0x00200B01, 0x0401F1A4, 0xD1F5B2A4, 0xE8BD4638, 0x210441F0,
        0xBBAEF000, 0x41F0E92D, 0x21044D27, 0xF0004628, 0x209FFBA9, 0xFED6F7FF, 0xF7FF20A5, 0x4604FED3,
        0xF7FF20A5, 0x4606FECF, 0xF7FF20A5, 0x4607FECB, 0x46282104, 0xFB94F000, 0xEA400420, 0x43382006,
        0x81F0E8BD, 0x4604B510, 0x48172104, 0xFB8AF000, 0xF7FF2003, 0xF3C4FEB7, 0xF7FF4007, 0xF3C4FEB3,
        0xF7FF2007, 0xB2E0FEAF, 0x4010E8BD, 0x20A5E6AA, 0xB570E6A8, 0x46054C0D, 0x46202102, 0xF922F000,
        0xD0F92800, 0x46204629, 0xF8D8F000, 0x46202101, 0xF918F000, 0xD0F92800, 0xE8BD4620, 0xF0004070,
        0x0000B8CF, 0x40010800, 0x40010C00, 0x40013000, 0xB5104997, 0xD10A4288, 0x21011484, 0xF0004620,
        0x4620FA4C, 0x4010E8BD, 0xF0002100, 0x4991BA46, 0xD1024288, 0x14042101, 0x498FE004, 0xD10A4288,
        0x13C42101, 0xF0004620, 0x4620FA41, 0x4010E8BD, 0xF0002100, 0xBD10BA3B, 0x8802B530, 0xF402884C,
        0x880A5341, 0x432288CD, 0x432C888C, 0x890C4322, 0x894C4322, 0x898C4322, 0x89CC4322, 0x431A4322,
        0x8B828002, 0x6200F422, 0x8A098382, 0xBD308201, 0x4605B5F0, 0x2002460C, 0x8BAA2100, 0x2601B085,
        0x0340F24F, 0x83AA401A, 0x8BAF8428, 0x2A0268A2, 0x88A0D024, 0x2602B100, 0xF0004668, 0x88E1F99C,
        0xF5B19800, 0xD02A7F00, 0xFBB00171, 0xBF00F0F1, 0x0080EB00, 0x004068A1, 0xF0F1FBB0, 0xB2801D40,
        0xFBB0210A, 0xF000F0F1, 0x1A400101, 0x004FF3C0, 0x1E820209, 0xD3012AFE, 0x21002002, 0x430888E2,
        0x842A4302, 0x88618820, 0x430889A2, 0x431188A1, 0x43384308, 0x6000F440, 0xB00583A8, 0x0A00BDF0,
        0x2100E7D6, 0x80418001, 0x80C18081, 0x81418101, 0x81C18181, 0x82012107, 0x21004770, 0x80418001,
        0x80C18081, 0x60822202, 0x47708181, 0x88012900, 0xF041D002, 0xE0010140, 0x0140F021, 0x47708001,
        0x8B812900, 0xF441D002, 0xE0016180, 0x6180F421, 0x47708381, 0x23010909, 0x2A00408B, 0xB2998882,
        0x430AD001, 0x438AE000, 0x47708082, 0x88822A00, 0x430AD001, 0x438AE000, 0x47708082, 0x47708181,
        0x47708980, 0x427EF5A1, 0x3AFF8801, 0xF441D002, 0xE0017180, 0x7180F421, 0x47708001, 0x88812900,
        0xF041D002, 0xE0010104, 0x0104F021, 0x47708081, 0xF4228802, 0x80026200, 0x430A8802, 0x47708002,
        0xF4418801, 0x80015180, 0x29004770, 0xD0028801, 0x5100F441, 0xF421E001, 0x80015100, 0x29014770,
        0x8B00D001, 0x8A804770, 0x8A004770, 0xF5B14770, 0x88014F80, 0xF421D003, 0x80014180, 0xF4414770,
        0xE7FA4180, 0x20004602, 0x420A8912, 0x2001D000, 0x43C94770, 0x47708101, 0xF001B510, 0x2201040F,
        0xF404FA02, 0x09092300, 0x8881408A, 0xB292B2A4, 0x40118900, 0xD0014220, 0x2301B101, 0xBD104618,
        0x020FF001, 0x40912101, 0x810143C9, 0x00004770, 0x40013000, 0x40003800, 0x40003C00, 0x680148A5,
        0x0101F041, 0x68416001, 0x40114AA3, 0x68016041, 0x40114AA2, 0x68016001, 0x2180F421, 0x68416001,
        0x01FEF421, 0xF44F6041, 0x6081011F, 0x49994770, 0xF422680A, 0x600A3280, 0xF422680A, 0x600A2280,
        0x3F80F5B0, 0xF5B0D007, 0xD1032F80, 0xF4406808, 0x600820A0, 0x68084770, 0x3080F440, 0x4602E7F9,
        0x09532000, 0x2B01498B, 0x2B02D00A, 0x6A49D00A, 0x021FF002, 0x40932301, 0xD000420B, 0x47702001,
        0xE7F56809, 0xE7F36A09, 0x2400B530, 0x65A0F44F, 0xF7FF2031, 0x1C64FFE4, 0xD00142AC, 0xD0F72800,
        0xF7FF2031, 0x2800FFDC, 0x2001D000, 0x4979BD30, 0xF022680A, 0xEA4202F8, 0x600800C0, 0x49784770,
        0x47706008, 0x68534A73, 0xF4234308, 0x4318137C, 0x47706050, 0x66084972, 0x4A6E4770, 0xF0216851,
        0x43010103, 0x47706051, 0x6840486A, 0x000CF000, 0x4A684770, 0xF0216851, 0x430101F0, 0x47706051,
        0x68514A64, 0x61E0F421, 0x60514301, 0x49614770, 0xF422684A, 0xEA425260, 0x604800C0, 0x4A5D4770,
        0x7A512900, 0x4301D001, 0x4381E000, 0x47707251, 0x6008495C, 0x4A574770, 0xF4216851, 0x43014140,
        0x47706051, 0x22004958, 0xF801700A, 0x28012920, 0x2804D002, 0x2005D102, 0x0020F881, 0x49534770,
        0x47706008, 0x6A0A494B, 0x620A4302, 0x494F4770, 0x60083944, 0x49474770, 0x684AB510, 0x030CF012,
        0xD0034A4B, 0xD0012B04, 0xD0282B08, 0x684A6002, 0xF0024B48, 0x091202F0, 0x5C9C444B, 0x40E26802,
        0x684C6042, 0x64E0F404, 0x5D1C0A24, 0xF404FA22, 0x684C6084, 0x5460F404, 0x24D4EA4F, 0xFA225D1B,
        0x60C2F203, 0x4B3B6849, 0x4140F401, 0xEA4F444B, 0x1F1B3191, 0xFBB25C59, 0x6101F1F1, 0x684ABD10,
        0xF402684B, 0xF04F1270, 0xF4130402, 0xEB043F80, 0xD0024292, 0x039B684B, 0x4B2FD501, 0x4B2CE000,
        0xE7C3435A, 0x29004A23, 0xD0016951, 0xE0004301, 0x61514381, 0x4A1F4770, 0x69912900, 0x4301D001,
        0x4381E000, 0x47706191, 0x29004A1A, 0xD00169D1, 0xE0004301, 0x61D14381, 0x4A164770, 0x68D12900,
        0x4301D001, 0x4381E000, 0x477060D1, 0x29004A11, 0xD0016911, 0xE0004301, 0x61114381, 0x49134770,
        0x60083940, 0x490E4770, 0x477064C8, 0x71C84909, 0x48084770, 0xF0416A41, 0x62417180, 0x4A054770,
        0x20004601, 0x420A6892, 0x2001D000, 0x49014770, 0x47707288, 0x40021000, 0xF8FF0000, 0xFEF6FFFF,
        0x42420000, 0x424200D8, 0x40021020, 0x42420480, 0x007A1200, 0x0000000C, 0x003D0900, 0xB510498F,
        0xD1064288, 0x20042101, 0xFFB7F7FF, 0x20042100, 0x498BE03B, 0xD1064288, 0x20082101, 0xFFADF7FF,
        0x20082100, 0x4987E031, 0xD1064288, 0x20102101, 0xFFA3F7FF, 0x20102100, 0x4983E027, 0xD1064288,
        0x20202101, 0xFF99F7FF, 0x20202100, 0x497FE01D, 0xD1064288, 0x20402101, 0xFF8FF7FF, 0x20402100,
        0x497BE013, 0xD1064288, 0x20802101, 0xFF85F7FF, 0x20802100, 0x4977E009, 0xD10A4288, 0x21011584,
        0xF7FF4620, 0x2100FF7A, 0xE8BD4620, 0xF7FF4010, 0xBD10BF74, 0x2101B510, 0xF7FF4608, 0x2100FF6E,
        0x4010E8BD, 0xF7FF2001, 0xB5F0BF68, 0x240078CB, 0x020FF003, 0xD50106DB, 0x431A788B, 0xF04F880B,
        0xF0130E0F, 0xF04F0FFF, 0xD01B0C01, 0x7000F8D0, 0xFA0C880D, 0x401DF304, 0xD10F429D, 0xFA0E00A6,
        0x43AFF506, 0xF506FA02, 0x78CD432F, 0xD0022D28, 0xD0022D48, 0x6143E002, 0x6103E000, 0x2C081C64,
        0x6007D3E6, 0x2BFF880B, 0x6847D91D, 0x0400F05F, 0x0508F104, 0xF305FA0C, 0x401D880D, 0xD10E429D,
        0xFA0E00A6, 0x43AFF506, 0xF506FA02, 0x78CD432F, 0xD1002D28, 0x78CD6143, 0xD1002D48, 0x1C646103,
        0xD3E52C08, 0xBDF06047, 0x71FFF64F, 0x21028001, 0x21047081, 0x477070C1, 0x20004602, 0x420A6892,
        0x2001D000, 0x68804770, 0x4770B280, 0x20004602, 0x420A68D2, 0x2001D000, 0x68C04770, 0x4770B280,
        0x47706101, 0x47706141, 0x6101B10A, 0x61414770, 0x60C14770, 0xF4414770, 0x61823280, 0x61826181,
        0x69806981, 0x4B2C4770, 0x681AB510, 0x7480F64F, 0xEA424022, 0x43081000, 0xBD106018, 0x61C84927,
        0xB5F04770, 0x28004C24, 0x69E3DA01, 0x6863E000, 0x01150D42, 0xF3C0B282, 0x40AA5601, 0x4703F3C0,
        0xD0052E03, 0xD50A02C5, 0x40BD2503, 0xE00743AB, 0xF0236865, 0xF0256370, 0x60656570, 0x4393E002,
        0x6370F043, 0x4313B101, 0xDA012800, 0xBDF061E3, 0xBDF06063, 0x078AB510, 0x0403F021, 0x0F13490E,
        0x220F4421, 0x409A688C, 0x608C4394, 0x4098688A, 0x608A4302, 0x490ABD10, 0x47706008, 0x40010800,
        0x40010C00, 0x40011000, 0x40011400, 0x40011800, 0x40011C00, 0x40012000, 0x40010000, 0x42200000,
        0x422000DC, 0x00000000, 0x00000000, 0x08060402, 0x00000000, 0x04030201, 0x04030201, 0x09080706,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
    ],

    'pc_Init'            : 0x20000049,
    'pc_UnInit'          : 0x2000005D,
    'pc_EraseSector'     : 0x20000061,
    'pc_ProgramPage'     : 0x20000077,
    'pc_Verify'          : 0x20000091,
    'pc_EraseChip'       : 0x12000001F,
    'pc_BlankCheck'      : 0x20000073,
    'pc_Read'            : 0x12000001F,
    
    'static_base'        : 0x20000C00,
    'begin_data'         : 0x20001000,
    'begin_stack'        : 0x20001400,

    'analyzer_supported' : False,

    # Relative region addresses and sizes
    'ro_start'           : 0x00000000,
    'ro_size'            : 0x00000BC4,
    'rw_start'           : 0x00000BC4,
    'rw_size'            : 0x0000001C,
    'zi_start'           : 0x00000BE0,
    'zi_size'            : 0x00000100,

    # Flash information
    'flash_start'        : 0xC0000000,
    'flash_size'         : 0x00800000,
    'flash_page_size'    : 0x00000100,
}
